C PROGRAMMING EXERCISES: FAST AND EASY WAY TO LEARN CODING BASICS by JP TAM
Author:JP TAM [TAM, JP]
Language: eng
Format: azw3, epub
Published: 2020-09-10T16:00:00+00:00
Program in C to Find Grade of a Student
To perform arithmetic operations using the Arithmetic Operators
To check and display the Grade used the Else If statement
PROGRAM
/* C program to Find Grade of a Student */
#include <stdio.h>
int main()
{
int english, chemistry, computers, physics, maths;
float Total, Percentage;
printf(" Please Enter the Five Subjects Marks : \n");
scanf("%d%d%d%d%d", &english, &chemistry, &computers, &physics, &maths);
Total = english + chemistry + computers + physics + maths;
Percentage = (Total / 500) * 100;
printf(" Total Marks = %.2f\n", Total);
printf(" Marks Percentage = %.2f", Percentage) ;
if(Percentage >= 90)
{
printf("\n Grade A");
}
else if(Percentage >= 80)
{
printf("\n Grade B");
}
else if(Percentage >= 70)
{
printf("\n Grade C");
}
else if(Percentage >= 60)
{
printf("\n Grade D");
}
else if(Percentage >= 40)
{
printf("\n Grade E");
}
else
{
printf("\n Fail");
}
return 0;
}
OUTPUT
Please Enter the Five Subjects Marks :
70 80 75 85 90
Total Marks = 400.00
Marks Percentage = 80.00
Grade B
Download
C PROGRAMMING EXERCISES: FAST AND EASY WAY TO LEARN CODING BASICS by JP TAM.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Filmora Efficient Editing by Alexander Zacharias(5779)
The Infinite Retina by Robert Scoble Irena Cronin(5256)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3975)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3935)
Edit Like a Pro with iMovie by Regit(3425)
Linux Administration Best Practices by Scott Alan Miller(2858)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2835)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2520)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2400)
Docker on Windows by Stoneman Elton(2318)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2315)
Creative Projects for Rust Programmers by Carlo Milanesi(2247)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2107)
Hands-On Linux for Architects by Denis Salamanca(2051)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2004)
Computers For Seniors For Dummies by Nancy C. Muir(1998)
The Old New Thing by Raymond Chen(1940)
Linux Kernel Debugging by Kaiwan N Billimoria(1762)
